﻿using FireStarterModeller.BO;
using Habanero.Testability;

namespace FireStarterModeller.Test.BO
{
    public class TestUtilsUIFormInfo
    {

        public static BOTestFactory<UIFormInfo> GetFactory()
        {
            return BOTestFactoryRegistry.Instance.Resolve<UIFormInfo>();
        }
        /// <summary>
        /// Creates a new saved UIFormInfo with a random value assigned to every property
        /// </summary>
        public static UIFormInfo CreateSavedUIFormInfo()
        {
            UIFormInfo uIFormInfo = CreateUnsavedValidUIFormInfo();
            uIFormInfo.Save();
            return uIFormInfo;
        }

        /// <summary>
        /// Creates a new unsaved UIFormInfo with a random value assigned to every property
        /// </summary>
        public static UIFormInfo CreateUnsavedValidUIFormInfo()
        {
/*            UIFormInfo uIFormInfo = CreateUnsavedValidUIFormInfo_WNoUIView();
            uIFormInfo.UIViewID = TestUtilsUIView.CreateSavedUIView().UIViewID;
            return uIFormInfo;*/
            return GetFactory().CreateValidBusinessObject();
        }
        /// <summary>
        /// Creates a new unsaved UIFormInfo with a random value assigned to every property
        /// </summary>
        public static UIFormInfo CreateUnsavedValidUIFormInfo_WNoUIView()
        {
 /*           UIFormInfo uIFormInfo = new UIFormInfo();
            uIFormInfo.Width = TestUtilsShared.GetRandomInt();
            uIFormInfo.Height = TestUtilsShared.GetRandomInt();
            uIFormInfo.Title = TestUtilsShared.GetRandomString();
            uIFormInfo.Generated = TestUtilsShared.GetRandomBoolean();
            return uIFormInfo;*/
            return GetFactory().WithOutSingleRelationships().CreateValidBusinessObject();
        }
	    
        /// <summary>
        /// Creates a new unsaved UIFormInfo where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static UIFormInfo CreateUnsavedDefaultUIFormInfo()
        {
            UIFormInfo uIFormInfo = new UIFormInfo();
            return uIFormInfo;
        }

    }
}